<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8"/>
		<meta name="viewport" content="width=device-width,initial-scale=1"/>
		<meta name="renderer" content="webkit|ie-comp|ie-stand"/>
		<title>{block name="title"}{/block} - 萌宝联盟</title>

		<link rel="stylesheet" type="text/css" href="/css/btstrap.css"/>
		<link rel="stylesheet" type="text/css" href="/css/base.css"/>
		<link rel="stylesheet" type="text/css" href="/css/style.css"/>
		<link rel="stylesheet" type="text/css" href="/css/moblie.css"/>
		
		<style type="text/css">
			input {
				-webkit-user-select: auto;
				-webkit-touch-callout: default;
				/*-webkit-overflow-scrolling: auto;*/
			}
		</style>
		{block name="resource"}{/block}

		<script type="text/javascript" src="/libs/bootstrap/js/jquery.min.js"></script>
		<script type="text/javascript" src="/js/yylm.js"></script>
	</head>
	<body>
		<div class="haeder">
			<div class="topbar">
				<div class="container">
					<div class="pull-right">
						<ul class="clearfix">
							{gt name="Think.session.user_id" value="0"}
							<li>{$Think.session.user_name}</li>
							<li><a href="/user_info">查看资料</a></li>
							<li><a href="/notice">消息</a></li>
							<li><a href="/logout">退出</a></li>
							{else/}
							<li><a href="#ale_login" class="ale_btn" >登录</a></li>
							<li><a href="#ale_zc" class="ale_btn">注册</a></li>
							{/gt}
						</ul>
					</div>
				</div>
			</div>

			<div class="logo_col">
				<div class="container">
					<div class="clearfix ">
						<div class="pull-left">
							<div class="logo_box">
								<a href="/"><img src="/images/logo.png?v0.0.1"/></a>
							</div>
						</div>
						<div class="pull-right">
							<div class="find_box">
								<div class="row">
									<div class="col-lg-12">
								    	<!--<div class="input-group">
								      		<input type="text" class="form-control" placeholder="请输入搜索内容">
								      		<span class="input-group-btn">
								        		<button class="btn btn-default" type="button"></button>
								      		</span>
								    	</div>-->
								  	</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>

			<div class="nav_col">
				<div class="container">
					<div class="row">
						<div class="col-md-2 col-xs-4 nav_list">
							<a href="/">萌宝联盟签到</a>
						</div>
						<div class="col-md-2 col-xs-4 nav_list">
							<a href="/user/vip">刷赚VIP会员</a>
						</div>
						<div class="col-md-2 col-xs-4 nav_list hover_nav">
							<a href="javascript:void(0);">萌宝联盟矿区</a>
							<ul class="tow_nav" style="z-index: 1000;">
								<li><a href="/diggings">我要接单</a></li>
								<li><a href="/farming">我的刷单</a></li>
								<li><a href="/withdraw">我的提现</a></li>
								<li><a href="/appointment">我的预约</a></li>
								<li><a href="/farming/record">刷单记录</a></li>
								<li><a href="/promotion">推广中心</a></li>
							</ul>
						</div>
					</div>
				</div>
			</div>
		</div>

		{block name="main"}{/block}

		<div class="footer">
			<p>萌宝联盟</p>
			<p>© 2017-2018 power by.</p>
		</div>
		{gt name="Think.session.user_id" value="0"}
		{else/}
		<div class="zhegai" id="ale_login" style="display: none;">
			<div class="login">
				<a href="javascript:;" class="clos"></a>
				<div class="login_box">
					<div class="ale_box_title">用户登录</div>
					<div class="ale_body">
						<form method="post" id="loginForm">
							<div class="inp_gruop">
								<i class="user"></i>
								<span>账 号</span>
								<input type="text" name="username" placeholder="输入账号"/>
							</div>
							<div class="inp_gruop">
								<i class="pasw"></i>
								<span>密 码</span>
								<input type="password" name="password" placeholder="输入密码"/>
							</div>
							<div class="inp_gruop">
								<i class="yz"></i>
								<span>验证码</span>
								<input type="text" name="captcha" placeholder="输入验证码"/>
								<p class="yzm_box">
									<img src="{:captcha_src()}" style="cursor: pointer;" onclick="this.src='{:captcha_src()}?v='+(new Date()).getTime();" alt="验证码" ></img>
								</p>
							</div>
							<div class="btn_box">
								<button class="btn_zdy">登　录</button>
							</div>
							<div class="text-right wjmm"><a href="javascript:;" class="wjmm_btn">忘记密码?</a></div>
						</form>
					</div>
				</div>
				<div class="zhmm" style="display: none;">
					<div class="ale_box_title">找回密码</div>
					<div class="ale_body">
						<form action="/forget/password" method="post" id="fotgetPasswordForm">
							<div class="inp_gruop">
								<span>账 号</span>
								<input type="text" name="username" id="fotgetPasswordUsername" placeholder="输入账号"/>
							</div>
							<div class="inp_gruop">
								<span>验证码</span>
								<input type="text" name="code" placeholder="输入验证码"/>
								<p class="yzm_box" id="fotgetPasswordSendCode"><a href="javascript:sendCode();">获取验证码</a></p>
							</div>
							<div class="inp_gruop">
								<span>新密码</span>
								<input type="password" name="password" placeholder="输入新密码"/>
							</div>
							<div class="inp_gruop">
								<span>确认新密码</span>
								<input type="password" name="comfirm_password" placeholder="输入确认新密码"/>
							</div>
							<div class="btn_box">
								<button class="btn_zdy">找回密码</button>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>

		<div class="zhegai" id="ale_zc" style="display: none;">
			<div class="login">
				<a href="javascript:;" class="clos"></a>
				<div class="zhmm">
					<div class="ale_box_title">注册账号</div>
					<div class="ale_body">
						<form action="/register" method="post" id="registerForm">
							<div class="inp_gruop">
								<span>推广人账号</span>
								<input type="text" name="promotion_username" placeholder="输入账号"/>
							</div>
							<div class="inp_gruop">
								<span>账号</span>
								<input type="text" name="username" placeholder="输入账号"/>
							</div>
							<div class="inp_gruop">
								<span>真实姓名</span>
								<input type="text" name="realname" placeholder="输入真实姓名"/>
							</div>
							<span>云付通账号，请认证填写，不能修改。</span>
							<div class="inp_gruop">
								<span>云付通账号</span>
								<input type="text" name="bank_code" placeholder="输入云付通账号"/>
							</div>
							<div class="inp_gruop">
								<span>手机号</span>
								<input type="text" name="phone" placeholder="输入手机号"/>
								<!--<p class="yzm_box">
									<a href="javascript:;">获取验证码</a>
								</p>-->
							</div>
							<!--<div class="inp_gruop">
								<span>验证码</span>
								<input type="text" name="" id="" value="" placeholder="输入账号"/>
							</div>-->
							<div class="inp_gruop">
								<span>密码</span>
								<input type="password" name="password" placeholder="输入密码"/>
							</div>
							<div class="inp_gruop">
								<span>确认密码</span>
								<input type="password" name="comfirm_password" placeholder="输入密码"/>
							</div>
							<div class="inp_gruop">
								<span>安全密码</span>
								<input type="password" name="pay_password" placeholder="输入安全密码"/>
							</div>
							<div class="inp_gruop">
								<span>确认安全密码</span>
								<input type="password" name="comfirm_pay_password" placeholder="输入安全密码"/>
							</div>
							<div class="inp_gruop">
								<span>验证码</span>
								<input type="text" name="captcha" placeholder="输入验证码"/>
								<p class="yzm_box">
									<img src="{:captcha_src()}" style="cursor: pointer;" onclick="this.src='{:captcha_src()}?v='+(new Date()).getTime();" alt="验证码" ></img>
								</p>
							</div>
							<div class="btn_box">
								<button class="btn_zdy">注　册</button>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
		{/gt}
		<script type="text/javascript">
			$('#loginForm').submit(function() {
				$.post('/login', $(this).serialize(),
					function(result) {
						if(result.code == 0) {
							alert(result.message);
							window.location.href = "/";
						} else {
							alert(result.message);
						}
					}, 'json');
				return false;
			});

			$('#registerForm').submit(function() {
				$.post('/register', $(this).serialize(),
					function(result) {
						if(result.code == 0) {
							alert(result.message);
							window.location.href = "/";
						} else {
							alert(result.message);
						}
					}, 'json');
				return false;
			});
			
			$('#fotgetPasswordForm').submit(function() {
				$.post('/forget/password', $(this).serialize(),
					function(result) {
						if(result.code == 0) {
							alert(result.message);
							window.location.href = "/";
						} else {
							alert(result.message);
						}
					}, 'json');
				return false;
			});

			function sendCode() {
				var username = $('#fotgetPasswordUsername').val();
				if(username == '') {
					alert('账号不能为空!');
					return false;
				}
				var num = 60;
				var sendCodeP = $('#fotgetPasswordSendCode');
				sendCodeP.html('<a href="javascript:void(0);">' + num + '秒后重新获取</a>');

				var onLoop = setInterval(function() {
					num--;
					if(num > 0) {
						sendCodeP.html('<a href="javascript:void(0);">' + num + '秒后重新获取</a>');
					} else {
						clearInterval(onLoop);
						sendCodeP.html('<a href="javascript:sendCode();">获取验证码</a>');
						num = 60;
					}
				}, 1000);

				$.post('/forget/sendCode',
					{"username": username},
					function(result) {
						if(result.code == 0) {
						} else {
							alert(result.message);
						}
					}, 'json');
				//return false;
				
			}
			
		</script>
		{block name="script"}{/block}
	</body>
</html>